
import { createRouter, createWebHistory } from 'vue-router';
import index from '@/view/index.vue';
import Manage from '@/view/Manage.vue';
import create from '@/view/create.vue';
import article from '@/view/article.vue';

const routes = [
  {
    path: '/:index?',
    name: 'index',
    component: index,
  },
  {
    path: '/manage',
    name: 'manage',
    component: Manage,
  },
  {
    path: '/create/:id',
    name: 'create',
    component: create,
  },
  {
    path: '/article/:id',
    name: 'article',
    component: article,
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;